import { request, request1 } from '@/utils/request';

//获取客户精简列表

export function getCustList(data) {
  return request({
    url: '/queue/cust-mgr/get-simple-list',
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}

//交易记录
export function getTransaction(params) {
  return request({
    url: '/queue/transaction/page-for-driver',
    headers: {
      isToken: true
    },
    method: 'GET',
    params
  });
}

//充值交易记录
export function getRechargeTransaction(params) {
  return request({
    url: '/queue/transaction/recharge-page-for-driver',
    headers: {
      isToken: true
    },
    method: 'GET',
    params
  });
}

//退款交易记录
export function getRefundTransaction(params) {
  return request({
    url: '/queue/transaction/refund-page-for-driver',
    headers: {
      isToken: true
    },
    method: 'GET',
    params
  });
}

//获取排号流程状态列表
export function getLineupStatus(data) {
  return request({
    url: '/queue/tenant-config/get-lineup-status-config',
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}

//获取运单流程状态列表
export function getWaybillStatus(data) {
  return request({
    url: '/queue/tenant-config/get-waybill-status-config',
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}

//获得司机排号信息分页
export function getLineUpByDriver(data) {
  return request({
    url: `/queue/lineup-info-mgr/page-by-driver`,
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}
// 获得司机排号信息详情
export function getLineUpDetail(params) {
  return request({
    url: `/queue/lineup-info-mgr/get-lineup-by-waybillno-for-driver`,
    headers: {
      isToken: true
    },
    method: 'GET',
    params
  });
}
// 获得司机停车场排号信息详情
export function getParkingLists(data) {
  return request({
    url: `/parking/queue-info/page-driver`,
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}

//校验该车辆是否有正在执行中的运单
export function checkRuningCar(data) {
  return request1({
    url: `/metering-docking/find-waybills-from-licensePlate`,
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}

// 获得企业排队禁停区域信息
export function getCorpAreaConfig(params) {
  return request({
    url: `/queue/corp-config/get-corp-area-config`,
    headers: {
      isToken: true
    },
    method: 'GET',
    params
  });
}

// 行驶证识别
export function getVehicleRecognize(url) {
  return request({
    url: `/queue/ocr/vehicle-recognize?url=${url}`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

// 身份证识别
export function getIdcardRecognize(url) {
  return request({
    url: `/queue/ocr/idcard-recognize?url=${url}`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

// 驾驶证识别
export function getDrivingRecognize(url) {
  return request({
    url: `/queue/ocr/driving-recognize?url=${url}`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

// 司机——上报运单最新定位
export function addWaybillgps(data) {
  return request({
    url: '/queue/waybillgps/create',
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}

//  获得司机
export function getDriving() {
  return request({
    url: `/queue/driver-mgr/get`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

//更新司机
export function updateDriving(data) {
  return request({
    url: '/queue/driver-mgr/update',
    headers: {
      isToken: true
    },
    method: 'PUT',
    data: data
  });
}

//获取车辆分页
export function getVehicle(data) {
  return request({
    url: `/queue/vehicle-mgr/page`,
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}
//获取车辆类型
export function getCarType(data) {
  return request1({
    url: `/coal-model/all`,
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}
//获取百吉接单扫码后的详情
// export function getDetailByCodeFromBJ(data) {
// 	return request1({
// 		url: `/coal-sendCar/by-show-from-applet`,
// 		headers: {
// 			isToken: true
// 		},
// 		method: 'POST',
// 		data: data
// 	})
// }
//获取百吉接单扫码后的详情
export function getDetailByCodeFromBJ(params) {
  return request1({
    url: `/metering-docking/find-coalSendCar-from-planNo`,
    headers: {
      isToken: true
    },
    method: 'GET',
    params
  });
}
//获取银行卡列表分页
export function getCard(data) {
  return request({
    url: `/queue/Card-mgr/page`,
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}
// 司机扫码
export function getScancode(data) {
  return request1({
    url: `/loading-coal/scan-qrcode`,
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}
// 创建车辆
export function addVehicle(data) {
  return request({
    url: '/queue/vehicle-mgr/create',
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}

// 更新车辆
export function updateVehicle(data) {
  return request({
    url: '/queue/vehicle-mgr/update',
    method: 'PUT',
    data: data
  });
}

// 解绑车辆
export function deleteVehicle(data) {
  return request({
    url: `/queue/vehicle-mgr/unbind?id=${data}`,
    method: 'DELETE'
  });
}

// 获取车辆详情
export function getVehicleDetail(data) {
  return request({
    url: `/queue/vehicle-mgr/get?id=${data}`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}
// 获取车辆字典
export function getVehicleDict() {
  return request({
    url: `/system/dict-data/list-all-simple`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

// 获取车辆单条数据
export function getVehicleOneDetail(id) {
  return request({
    url: `/queue/vehicle-mgr/get?id=${id}`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

// 获得司机运单分页  获取运输计划列表
export function getWayBillList(data) {
  return request({
    url: `/queue/waybill/page-for-driver`,
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}

// 通过运单编号，获得司机运单
export function getWayBillDetail(data) {
  return request({
    url: `/queue/waybill/get-waybill-by-waybillno-for-driver?waybillNo=${data}`,
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}

// 获得司机最新运单信息
export function getWayBillDetailLatest(header, params) {
  return request({
    url: `/queue/waybill/get-latest-waybill-for-driver`,
    headers: {
      isToken: true,
      ...header
    },
    method: 'GET',
    params
  });
}

// 获得司机最新运单信息
export function getWayBillDetailForDriver() {
  return request({
    url: `/queue/waybill/get-latest-inTransit-waybill-for-driver`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

// 获取司机用户信息
export function getUserProfile(data) {
  return request({
    url: `/system/user/profile/get-driver`,
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}

//司机——创建排号信息
export function creatLineUp(data) {
  return request({
    url: `/queue/lineup-info-mgr/create`,
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}

// 获取接单运输计划详情
export function getTransPlanDetail(params) {
  return request1({
    url: `/metering-docking/find-purchaseCoalSendCar-from-planNo`,
    headers: {
      isToken: true
    },
    method: 'GET',
    params
  });
}
// 获取接单运输计划详情
export function getTransPlanDetailData(planNo) {
  return request({
    url: `/queue/transport-plan/get?id=${planNo}`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}
// 获取接单中的产品下拉列表
export function getProductsLists(supId) {
  return request1({
    url: `/purchase-prosup/get-product/${supId}`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}
// 司机发运——接单
export function addWaybillListsBJ(data) {
  return request1({
    url: '/coal-sendCar/add-order-from-applet',
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}
// 司机发运——创建运单
export function addWaybillLists(data) {
  return request1({
    url: '/purchase-coal-send-car/add-order-from-applet',
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}
// 司机jiyun——创建运单
export function addWaybillJiyun(data) {
  return request1({
    url: '/purchase-coal-send-car/add-order-from-consolidation',
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}
// 司机——创建运单
export function addWaybill(data) {
  return request({
    url: '/queue/waybill/create',
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}

//  获得租户配置
export function getTenantConfig() {
  return request({
    url: `/queue/tenant-config/get`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

// 取消排队
export function cancelQueue(data) {
  return request({
    url: '/queue/lineup-info-mgr/cancel',
    method: 'PUT',
    params: data
  });
}
// 创建违规信息
export function addViolation(data) {
  return request({
    url: '/queue/violation-info-mgr/create-for-driver',
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}
// 更新违规信息
export function updateViolation(data) {
  return request({
    url: '/queue/violation-info-mgr/update-for-driver',
    headers: {
      isToken: true
    },
    method: 'PUT',
    data: data
  });
}

// 支付
export function paymentReq(data) {
  return request({
    url: '/queue/violation-info-mgr/create-for-driver',
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}

//获得字典数据
export function getDictDatas() {
  return request({
    url: `/system/dict-data/list-all-simple`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

//获得当前企业基础配置
export function getConfigData(params) {
  return request({
    url: `/queue/corp-config/get-corp-config-by-type`,
    headers: {
      isToken: true
    },
    method: 'GET',
    params
  });
}
// 获得停车场排号详情
export function getParkingDetail(id) {
  return request({
    url: `/parking/queue-info/get-detail?id=${id}`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

// 获取排号开关接口
export function findLineupSwitchByTenant(enterId) {
  return request1({
    url: `/metering-docking/find-lineupSwitch-byTenant/${enterId}`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

export function findDriverWaybill(data) {
  return request1({
    url: '/metering-docking/find-driver-waybill',
    headers: {
      isToken: true
    },
    method: 'POST',
    data
  });
}
export function getPayeeInfoLists(data) {
  return request({
    url: `/queue/back-card/getPayeeInfo`,
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}
//  获得司机
export function getDrivingList(netCargoCompanyId) {
  return request({
    url: `/queue/driver-mgr/get?networkFreight=${netCargoCompanyId}`,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}

//  获得司机
export function getStopAreaLimit(params) {
  return request({
    url: '/queue/vip-vehicle/getStopAreaLimit',
    headers: {
      isToken: true
    },
    method: 'GET',
    params
  });
}
